<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>📜 合同智审 - AI合同审核专家</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <!-- 配置Tailwind自定义颜色 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#0F52BA', // 深蓝色：专业、可信赖
                        secondary: '#1E90FF', // 亮蓝色：辅助色
                        accent: '#FF6B00', // 橙色：强调重要信息
                        success: '#36B37E', // 成功绿
                        warning: '#FFAB00', // 警告黄
                        danger: '#FF5630', // 危险红
                        neutral: '#6B7280', // 中性灰
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    }
                }
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .card-shadow {
                box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            }
            .transition-all-300 {
                transition: all 300ms ease-in-out;
            }
            .risk-high {
                @apply bg-red-50 border-l-4 border-danger p-3 my-2;
            }
            .risk-medium {
                @apply bg-yellow-50 border-l-4 border-warning p-3 my-2;
            }
            .risk-low {
                @apply bg-green-50 border-l-4 border-success p-3 my-2;
            }
        }
    </style>
</head>
<body class="bg-gray-50 font-sans text-gray-800">
    <div class="container mx-auto px-4 py-8 max-w-7xl">
        <!-- 页面头部 -->
        <header class="text-center mb-10">
            <div class="inline-block bg-primary text-white p-3 rounded-full shadow-lg mb-4">
                <i class="fa fa-gavel text-3xl"></i>
            </div>
            <h1 class="text-[clamp(1.8rem,4vw,2.5rem)] font-bold text-primary mb-3">合同智审</h1>
            <p class="text-neutral text-lg max-w-2xl mx-auto">AI驱动的智能合同审核助手，快速识别风险点，提供专业修改建议</p>
        </header>
        
        <!-- 主内容区 -->
        <div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-10">
            <!-- 左侧：参数设置 -->
            <div class="lg:col-span-1">
                <div class="bg-white rounded-xl shadow-md p-6 h-full">
                    <h2 class="text-xl font-bold text-primary mb-5 flex items-center">
                        <i class="fa fa-sliders mr-2"></i>审核设置
                    </h2>
                    
                    <div class="space-y-5">
                        <!-- 合同类型 -->
                        <div>
                            <label for="contractType" class="block text-sm font-medium text-gray-700 mb-1">合同类型 *</label>
                            <select id="contractType" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-primary transition-all-300">
                                <option value="劳动合同">劳动合同</option>
                                <option value="租赁合同">租赁合同</option>
                                <option value="销售合同">销售合同</option>
                                <option value="服务合同">服务合同</option>
                                <option value="保密协议">保密协议</option>
                                <option value="合作协议">合作协议</option>
                                <option value="采购合同">采购合同</option>
                                <option value="借款合同">借款合同</option>
                                <option value="股权转让协议">股权转让协议</option>
                                <option value="知识产权许可协议">知识产权许可协议</option>
                            </select>
                        </div>
                        
                        <!-- 审核维度 -->
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">审核维度 (可多选) *</label>
                            <div id="dimensionsContainer" class="space-y-2">
                                <!-- 由JavaScript动态填充 -->
                            </div>
                        </div>
                        
                        <!-- 特别关注点 -->
                        <div>
                            <label for="focusPoints" class="block text-sm font-medium text-gray-700 mb-1">特别关注点 (可选)</label>
                            <textarea id="focusPoints" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-primary transition-all-300" placeholder="例如：付款条件、违约责任、保密期限等..."></textarea>
                        </div>
                        
                        <!-- 文件上传 -->
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-1">上传合同文件 (可选)</label>
                            <div class="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg">
                                <div class="space-y-1 text-center">
                                    <i class="fa fa-cloud-upload text-3xl text-gray-400 mb-2"></i>
                                    <div class="flex text-sm text-gray-600">
                                        <label for="fileUpload" class="relative cursor-pointer bg-white rounded-md font-medium text-primary hover:text-primary/80">
                                            <span>上传文件</span>
                                            <input id="fileUpload" name="file" type="file" accept=".txt,.docx,.pdf" class="sr-only">
                                        </label>
                                        <p class="pl-1">或拖放文件</p>
                                    </div>
                                    <p class="text-xs text-gray-500">支持 TXT、DOCX、PDF 格式，最大10MB</p>
                                </div>
                            </div>
                            <div id="fileStatus" class="mt-2 text-sm text-gray-600 hidden"></div>
                        </div>
                        
                        <!-- 合同文本输入 -->
                        <div>
                            <label for="contractContent" class="block text-sm font-medium text-gray-700 mb-1">或输入合同文本 *</label>
                            <textarea id="contractContent" rows="6" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-primary transition-all-300" placeholder="请粘贴合同文本内容到这里..."></textarea>
                        </div>
                        
                        <!-- 操作按钮 -->
                        <div class="pt-4 space-y-3">
                            <button id="reviewBtn" class="w-full bg-primary hover:bg-primary/90 text-white font-medium py-3 px-4 rounded-lg transition-all-300 flex items-center justify-center">
                                <i class="fa fa-search mr-2"></i> 开始审核
                            </button>
                            <button id="clearBtn" class="w-full bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-2 px-4 rounded-lg transition-all-300">
                                清空内容
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 右侧：合同内容与结果 -->
            <div class="lg:col-span-2 space-y-6">
                <!-- 加载状态 -->
                <div id="loading" class="bg-white rounded-xl shadow-md p-8 text-center hidden">
                    <div class="inline-block animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary mb-4"></div>
                    <p class="text-gray-600">正在智能审核合同，请稍候... 复杂合同可能需要更长时间</p>
                </div>
                
                <!-- 错误信息 -->
                <div id="errorMessage" class="bg-red-50 border-l-4 border-red-400 p-4 rounded-r-lg hidden">
                    <div class="flex">
                        <div class="flex-shrink-0">
                            <i class="fa fa-exclamation-circle text-red-500"></i>
                        </div>
                        <div class="ml-3">
                            <p class="text-sm text-red-700" id="errorText"></p>
                        </div>
                    </div>
                </div>
                
                <!-- 审核结果 -->
                <div id="resultArea" class="bg-white rounded-xl shadow-md overflow-hidden hidden">
                    <div class="bg-primary text-white p-4 flex justify-between items-center">
                        <h2 class="text-xl font-bold flex items-center">
                            <i class="fa fa-check-circle mr-2"></i> 合同审核结果
                        </h2>
                        <div class="flex space-x-2">
                            <button id="downloadResultBtn" class="bg-white text-primary px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-100 transition-all-300">
                                <i class="fa fa-download mr-1"></i> 下载结果
                            </button>
                            <button id="copyResultBtn" class="bg-white text-primary px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-100 transition-all-300">
                                <i class="fa fa-copy mr-1"></i> 复制结果
                            </button>
                        </div>
                    </div>
                    <div class="p-6">
                        <!-- 风险摘要卡片 -->
                        <div id="riskSummary" class="mb-8 p-5 bg-blue-50 rounded-lg border border-blue-100">
                            <h3 class="font-bold text-lg text-primary mb-3 flex items-center">
                                <i class="fa fa-bar-chart mr-2"></i> 风险评估摘要
                            </h3>
                            <div id="riskSummaryContent" class="text-gray-700">
                                <!-- 风险摘要将在这里显示 -->
                            </div>
                        </div>
                        
                        <!-- 审核详情 -->
                        <div id="resultContent" class="prose max-w-none">
                            <!-- 审核结果将在这里显示 -->
                        </div>
                    </div>
                </div>
                
                <!-- 风险等级说明 -->
                <div class="bg-white rounded-xl shadow-md p-6">
                    <h3 class="font-bold text-lg text-primary mb-4">风险等级说明</h3>
                    <div class="space-y-3">
                        <div class="flex">
                            <div class="flex-shrink-0 w-3 h-3 rounded-full bg-danger mt-1.5"></div>
                            <div class="ml-3">
                                <h4 class="font-medium text-danger">高风险</h4>
                                <p class="text-sm text-gray-600 mt-0.5">可能导致重大法律责任或经济损失，必须修改</p>
                            </div>
                        </div>
                        <div class="flex">
                            <div class="flex-shrink-0 w-3 h-3 rounded-full bg-warning mt-1.5"></div>
                            <div class="ml-3">
                                <h4 class="font-medium text-warning">中风险</h4>
                                <p class="text-sm text-gray-600 mt-0.5">存在一定风险，建议修改以避免潜在问题</p>
                            </div>
                        </div>
                        <div class="flex">
                            <div class="flex-shrink-0 w-3 h-3 rounded-full bg-success mt-1.5"></div>
                            <div class="ml-3">
                                <h4 class="font-medium text-success">低风险</h4>
                                <p class="text-sm text-gray-600 mt-0.5">风险较小，但仍有优化空间</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 功能特点 -->
        <div class="bg-white rounded-xl shadow-md p-6 mb-10">
            <h2 class="text-xl font-bold text-primary mb-6 text-center">合同智审的核心优势</h2>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                <div class="p-5 border border-gray-100 rounded-lg hover:shadow-lg transition-all-300">
                    <div class="text-primary text-3xl mb-3"><i class="fa fa-bolt"></i></div>
                    <h3 class="font-bold text-lg mb-2">快速高效</h3>
                    <p class="text-gray-600 text-sm">几秒钟内完成人工需要数小时的审核工作，大幅提高工作效率</p>
                </div>
                <div class="p-5 border border-gray-100 rounded-lg hover:shadow-lg transition-all-300">
                    <div class="text-primary text-3xl mb-3"><i class="fa fa-shield"></i></div>
                    <h3 class="font-bold text-lg mb-2">风险识别</h3>
                    <p class="text-gray-600 text-sm">精准识别合同中的潜在风险点，降低法律纠纷和经济损失风险</p>
                </div>
                <div class="p-5 border border-gray-100 rounded-lg hover:shadow-lg transition-all-300">
                    <div class="text-primary text-3xl mb-3"><i class="fa fa-lightbulb-o"></i></div>
                    <h3 class="font-bold text-lg mb-2">专业建议</h3>
                    <p class="text-gray-600 text-sm">提供专业的修改建议和替代条款，帮助完善合同内容</p>
                </div>
            </div>
        </div>
        
        <!-- 页脚 -->
        <footer class="text-center text-gray-500 text-sm py-6">
            <p>合同智审 &copy; 2025 | AI合同审核助手</p>
            <p class="mt-2">免责声明：本工具仅提供参考意见，不构成法律建议，请结合专业法律人士意见使用</p>
        </footer>
    </div>

    <script>
        // 合同类型对应的配置（审核维度和关注点）
        const CONTRACT_CONFIG = {
            "劳动合同": {
                "dimensions": ["条款完整性", "法律合规性", "用工风险", "薪酬福利条款", "解约条款"],
                "focus_points": ["试用期约定", "薪资结构", "竞业限制", "社会保险", "解除合同条款"]
            },
            "租赁合同": {
                "dimensions": ["条款完整性", "租赁期限合规", "租金支付条款", "维修责任划分", "违约责任"],
                "focus_points": ["租赁期限", "租金支付", "违约责任", "房屋修缮", "转租条款"]
            },
            "销售合同": {
                "dimensions": ["产品描述准确性", "价格与支付条款", "交货与验收标准", "质量保证条款", "违约责任"],
                "focus_points": ["价款支付", "交货方式", "质量标准", "验收条款", "违约责任"]
            },
            "服务合同": {
                "dimensions": ["服务范围明确性", "服务标准量化", "付款条件合理性", "服务期限明确性", "保密条款"],
                "focus_points": ["服务范围", "验收标准", "付款条件", "保密条款", "违约责任"]
            },
            "保密协议": {
                "dimensions": ["保密范围界定", "保密期限合理性", "泄密责任明确性", "例外情况条款", "知识产权保护"],
                "focus_points": ["保密范围", "保密期限", "违约责任", "例外情况", "知识产权"]
            },
            "合作协议": {
                "dimensions": ["合作范围明确性", "权利义务划分", "出资与收益分配", "决策机制设置", "退出机制"],
                "focus_points": ["出资比例", "利润分配", "决策权分配", "退出机制", "保密条款"]
            },
            "采购合同": {
                "dimensions": ["货物规格明确性", "验收标准量化", "付款条件合理性", "交付时间约定", "违约责任"],
                "focus_points": ["货物规格", "验收标准", "付款条件", "违约责任", "争议解决"]
            },
            "借款合同": {
                "dimensions": ["借款金额与用途", "利率合规性", "还款方式明确性", "担保条款有效性", "逾期责任"],
                "focus_points": ["借款金额", "利率约定", "还款方式", "担保条款", "违约责任"]
            },
            "股权转让协议": {
                "dimensions": ["转让标的明确性", "价格与支付条款", "交割条件设置", "陈述与保证条款", "税费承担"],
                "focus_points": ["转让价格", "支付方式", "股权交割", "陈述与保证", "税费承担"]
            },
            "知识产权许可协议": {
                "dimensions": ["许可范围界定", "许可期限合理性", "使用费支付条款", "侵权责任划分", "保密条款"],
                "focus_points": ["许可范围", "许可期限", "使用费", "侵权责任", "保密条款"]
            }
        };

        // DOM元素
        const contractType = document.getElementById('contractType');
        const dimensionsContainer = document.getElementById('dimensionsContainer');
        const focusPoints = document.getElementById('focusPoints');
        const fileUpload = document.getElementById('fileUpload');
        const fileStatus = document.getElementById('fileStatus');
        const contractContent = document.getElementById('contractContent');
        const reviewBtn = document.getElementById('reviewBtn');
        const clearBtn = document.getElementById('clearBtn');
        const copyResultBtn = document.getElementById('copyResultBtn');
        const downloadResultBtn = document.getElementById('downloadResultBtn');
        const loading = document.getElementById('loading');
        const errorMessage = document.getElementById('errorMessage');
        const errorText = document.getElementById('errorText');
        const resultArea = document.getElementById('resultArea');
        const resultContent = document.getElementById('resultContent');
        const riskSummary = document.getElementById('riskSummary');
        const riskSummaryContent = document.getElementById('riskSummaryContent');

        // 初始化审核维度
        function initDimensions(contractTypeValue) {
            const config = CONTRACT_CONFIG[contractTypeValue];
            dimensionsContainer.innerHTML = '';
            
            config.dimensions.forEach(dimension => {
                const label = document.createElement('label');
                label.className = 'flex items-center';
                
                const checkbox = document.createElement('input');
                checkbox.type = 'checkbox';
                checkbox.className = 'form-checkbox h-4 w-4 text-primary rounded';
                checkbox.name = 'dimensions';
                checkbox.value = dimension;
                checkbox.checked = true; // 默认全选
                
                const span = document.createElement('span');
                span.className = 'ml-2 text-sm text-gray-700';
                span.textContent = dimension;
                
                label.appendChild(checkbox);
                label.appendChild(span);
                dimensionsContainer.appendChild(label);
            });
        }

        // 获取选中的审核维度
        function getSelectedDimensions() {
            const checkboxes = document.querySelectorAll('input[name="dimensions"]:checked');
            return Array.from(checkboxes).map(cb => cb.value.trim());
        }

        // 文件上传处理
        fileUpload.addEventListener('change', function(e) {
            const file = e.target.files[0];
            if (file) {
                // 检查文件大小（10MB）
                if (file.size > 10 * 1024 * 1024) {
                    fileStatus.textContent = "文件过大，请上传小于10MB的文件";
                    fileStatus.classList.remove('hidden', 'text-green-600');
                    fileStatus.classList.add('text-red-500');
                    return;
                }
                
                fileStatus.textContent = `已选择文件: ${file.name}，正在解析...`;
                fileStatus.classList.remove('hidden', 'text-red-500');
                fileStatus.classList.add('text-blue-600');
                
                // 处理文件
                const reader = new FileReader();
                reader.onload = function(e) {
                    // 对于文本文件，直接显示内容
                    const fileExt = file.name.split('.').pop().toLowerCase();
                    if (fileExt === 'txt') {
                        contractContent.value = e.target.result.slice(0, 10000); // 限制显示长度
                        fileStatus.textContent = `已解析文件: ${file.name}（仅显示前10000字符）`;
                        fileStatus.classList.remove('text-blue-600');
                        fileStatus.classList.add('text-green-600');
                    } else {
                        fileStatus.textContent = `已选择文件: ${file.name}（非文本文件，请上传文本或使用文件解析）`;
                        fileStatus.classList.remove('text-blue-600');
                        fileStatus.classList.add('text-green-600');
                    }
                };
                
                if (file.type.includes('text')) {
                    reader.readAsText(file);
                } else {
                    reader.readAsArrayBuffer(file);
                    // 非文本文件仅显示已选择
                    setTimeout(() => {
                        fileStatus.textContent = `已选择文件: ${file.name}（请点击审核按钮进行处理）`;
                        fileStatus.classList.remove('text-blue-600');
                        fileStatus.classList.add('text-green-600');
                    }, 1000);
                }
            }
        });

        // 合同类型变化时更新审核维度和关注点
        contractType.addEventListener('change', function() {
            const type = this.value;
            const config = CONTRACT_CONFIG[type];
            
            // 更新审核维度
            initDimensions(type);
            
            // 更新推荐关注点
            focusPoints.placeholder = `推荐关注点：${config.focus_points.join('、')}`;
        });

        // 审核按钮点击事件
        reviewBtn.addEventListener('click', async function() {
            // 验证输入
            const content = contractContent.value.trim();
            const hasFile = fileUpload.files.length > 0;
            
            if (!content && !hasFile) {
                showError('请输入合同文本或上传合同文件后再进行审核');
                return;
            }
            
            const dimensions = getSelectedDimensions();
            if (dimensions.length === 0) {
                showError('请至少选择一个审核维度');
                return;
            }
            
            // 准备数据
            const formData = new FormData();
            formData.append('contract_type', contractType.value);
            formData.append('focus_points', focusPoints.value.trim());
            
            // 添加选中的审核维度
            dimensions.forEach(dim => {
                formData.append('review_dimensions', dim);
            });
            
            // 添加合同文本
            if (content) {
                formData.append('contract_text', content);
            }
            
            // 添加文件（如果有）
            if (hasFile) {
                formData.append('file', fileUpload.files[0]);
            }
            
            // 显示加载状态
            showLoading();
            
            try {
                // 发送请求
                const response = await fetch('/api/review', {
                    method: 'POST',
                    body: formData
                });
                
                const result = await response.json();
                
                if (response.ok && result.success) {
                    // 提取风险摘要（前200字符）
                    const summary = result.result.length > 200 
                        ? result.result.substring(0, 200) + '...' 
                        : result.result;
                    
                    // 格式化结果
                    const formattedResult = formatResult(result.result);
                    
                    // 显示结果
                    riskSummaryContent.textContent = summary;
                    resultContent.innerHTML = formattedResult;
                    showResult();
                } else {
                    throw new Error(result.error || '审核失败，请重试');
                }
            } catch (error) {
                console.error('审核错误:', error);
                showError(error.message);
            }
        });

        // 格式化结果，添加风险样式
        function formatResult(text) {
            // 替换标题格式
            let formatted = text
                .replace(/\n/g, '<br>')
                .replace(/### (.*?)/g, '<h3 class="text-lg font-bold mt-4 mb-2 text-primary">$1</h3>')
                .replace(/## (.*?)/g, '<h2 class="text-xl font-bold mt-6 mb-3 text-primary">$1</h2>');
            
            // 识别风险等级并添加样式
            formatted = formatted
                .replace(/风险等级：高/g, '<span class="text-danger font-bold">风险等级：高</span>')
                .replace(/风险等级：中/g, '<span class="text-warning font-bold">风险等级：中</span>')
                .replace(/风险等级：低/g, '<span class="text-success font-bold">风险等级：低</span>');
                
            // 为风险点添加边框样式
            const riskSections = formatted.split('<br>');
            const styledSections = riskSections.map(section => {
                if (section.includes('风险等级：高')) {
                    return `<div class="risk-high">${section}</div>`;
                } else if (section.includes('风险等级：中')) {
                    return `<div class="risk-medium">${section}</div>`;
                } else if (section.includes('风险等级：低')) {
                    return `<div class="risk-low">${section}</div>`;
                }
                return section;
            });
            
            return styledSections.join('');
        }

        // 清空按钮点击事件
        clearBtn.addEventListener('click', function() {
            const defaultType = "劳动合同";
            contractType.value = defaultType;
            focusPoints.value = '';
            contractContent.value = '';
            fileUpload.value = '';
            fileStatus.classList.add('hidden');
            errorMessage.classList.add('hidden');
            resultArea.classList.add('hidden');
            
            // 更新审核维度和关注点
            contractType.dispatchEvent(new Event('change'));
        });

        // 复制结果按钮点击事件
        copyResultBtn.addEventListener('click', function() {
            const text = resultContent.textContent;
            
            navigator.clipboard.writeText(text).then(() => {
                const originalText = copyResultBtn.innerHTML;
                copyResultBtn.innerHTML = '<i class="fa fa-check mr-1"></i> 已复制';
                copyResultBtn.classList.add('bg-green-500');
                copyResultBtn.classList.remove('bg-white', 'text-primary');
                
                setTimeout(() => {
                    copyResultBtn.innerHTML = originalText;
                    copyResultBtn.classList.remove('bg-green-500');
                    copyResultBtn.classList.add('bg-white', 'text-primary');
                }, 2000);
            }).catch(err => {
                console.error('复制失败:', err);
                alert('复制失败，请手动复制');
            });
        });

        // 下载结果按钮点击事件
        downloadResultBtn.addEventListener('click', function() {
            const text = resultContent.textContent;
            const blob = new Blob([text], { type: 'text/plain' });
            const url = URL.createObjectURL(blob);
            
            const a = document.createElement('a');
            a.href = url;
            a.download = `合同审核结果_${new Date().toLocaleDateString().replace(/\//g, '-')}.txt`;
            document.body.appendChild(a);
            a.click();
            
            // 清理
            setTimeout(() => {
                document.body.removeChild(a);
                URL.revokeObjectURL(url);
            }, 0);
        });

        // 显示加载状态
        function showLoading() {
            loading.classList.remove('hidden');
            errorMessage.classList.add('hidden');
            resultArea.classList.add('hidden');
            reviewBtn.disabled = true;
            reviewBtn.innerHTML = '<i class="fa fa-spinner fa-spin mr-2"></i> 审核中...';
        }

        // 显示错误信息
        function showError(message) {
            errorText.textContent = message;
            errorMessage.classList.remove('hidden');
            loading.classList.add('hidden');
            resultArea.classList.add('hidden');
            reviewBtn.disabled = false;
            reviewBtn.innerHTML = '<i class="fa fa-search mr-2"></i> 开始审核';
        }

        // 显示审核结果
        function showResult() {
            resultArea.classList.remove('hidden');
            loading.classList.add('hidden');
            errorMessage.classList.add('hidden');
            reviewBtn.disabled = false;
            reviewBtn.innerHTML = '<i class="fa fa-search mr-2"></i> 开始审核';
            
            // 滚动到结果区域
            resultArea.scrollIntoView({ behavior: 'smooth' });
        }

        // 页面加载时初始化
        window.addEventListener('load', function() {
            // 初始化默认合同类型的审核维度
            initDimensions(contractType.value);
            // 触发合同类型变化事件以设置关注点
            contractType.dispatchEvent(new Event('change'));
        });
    </script>
</body>
</html>
